import { ADD_TODO, TOGGLE_TODO, REMOVE_TODO } from './ActionTypes.js';
export default (state = [], action) => {
	switch (action.type) {
		case ADD_TODO: {
			return [
				...state,
				{
					id: action.id,
					text: action.text,
					type: action.type,
					completed: false
				}
			]
		}
		/*
		if(action.type === 'change_input_value'){
			// const newState = JSON.parse(JSON.stringify(state));
				const newState = [...state]
			newState.inputValue = action.value
			return newState
		}
		
		
		*/
		default: {
			return state;
		}
	}
}
